import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 机构信息
 */
@Entity('org_info')
export class OrgInfoEntity extends BaseEntity {
  @Column({ comment: '名称', length: 255 })
  name: string;

  @Column({ comment: '简称', length: 50, nullable: true })
  shortName: string;

  @Column({ comment: 'Logo', length: 255, nullable: true })
  logo: string;

  @Column({ comment: '机构类型', dict: ['总机构', '分支机构'], default: 0 })
  type: number;

  @Column({ comment: '联系人', length: 50, nullable: true })
  contact: string;

  @Column({ comment: '联系电话', length: 20, nullable: true })
  phone: string;

  @Column({ comment: '地址', length: 255, nullable: true })
  address: string;

  @Column({ comment: '状态', dict: ['停用', '启用'], default: 1 })
  status: number;

  @Column({ comment: '排序号', default: 0 })
  orderNo: number;

  @Index()
  @Column({ comment: '上级机构ID', nullable: true })
  parentId: number;
}
